#pragma once
class CNetSevice;
class ZMCommunicateMain
{
public:
	enum emDevice
	{
		DEVICE_QT,
		DEVICE_UNITY3D,
		DEVICE_OGRE
	};
	enum emFnc
	{
		Func_DEFAULT
	};

public:
	static SharedPointer<ZMCommunicateMain> GetInstance()
	{
		if (!m_pCommunicateMain.get())
		{
			m_pCommunicateMain = SharedPointer<ZMCommunicateMain>(new ZMCommunicateMain());
		}
		return m_pCommunicateMain;
	}

	ZMCommunicateMain();
	
	~ZMCommunicateMain();
	
	void WriteData(const ZMVector<unsigned char>& data,  emDevice idDeviceType = DEVICE_OGRE, emFnc cFunc = Func_DEFAULT, int idDevice = 1);

	void Start(ZMString strIP, ZMString iPort);
private:
	static SharedPointer<ZMCommunicateMain> m_pCommunicateMain;
	SharedPointer<CNetSevice> m_pNetMain;
};

